package com.example.clothingmanager.bean;

import javax.persistence.*;
import java.sql.Date;
import java.util.Objects;

/**
 * @author Huangyt
 * @version 1.0
 * @date 2020/5/9 15:20
 */
@Entity
@Table(name = "tb_instock", schema = "jsp_test")
public class Instock {
    private String isitem;
    private Depot depot;
    private Date indate;
    private String operator;
    private String source;

    private Clothes clothes;

    private int num;
    private double price;
    private double sum;

    @Id
    @Column(name = "isitem")
    public String getIsitem() {
        return isitem;
    }

    public void setIsitem(String isitem) {
        this.isitem = isitem;
    }

    @ManyToOne
    @JoinColumn(name="depotid")
    public Depot getDepot() {
        return depot;
    }

    public void setDepot(Depot depot) {
        this.depot = depot;
    }

    @Basic
    @Column(name = "indate")
    public Date getIndate() {
        return indate;
    }

    public void setIndate(Date indate) {
        this.indate = indate;
    }

    @Basic
    @Column(name = "operator")
    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    @Basic
    @Column(name = "source")
    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    @Basic
    @ManyToOne
    @JoinColumn(name="citem")
    public Clothes getClothes() {
        return clothes;
    }

    public void setClothes(Clothes clothes) {
        this.clothes = clothes;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getSum() {
        return sum;
    }

    public void setSum(double sum) {
        this.sum = sum;
    }

    @Override
    public String toString() {
        return "Instock{" +
                "isitem='" + isitem + '\'' +
                ", depot=" + depot +
                ", indate=" + indate +
                ", operator='" + operator + '\'' +
                ", source='" + source + '\'' +
                ", clothes=" + clothes +
                ", num=" + num +
                ", price=" + price +
                ", sum=" + sum +
                '}';
    }
}
